package hcn.protocol.brandnew.zhenliao.jianyan;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
import hcn.protocol.brandnew.BaseRequest;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;


/**
 * 检验危急值确认反馈-请求消息 - ODS_03050302
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "MsgBody")
@XmlAccessorType(XmlAccessType.FIELD)
public class LabWarnResultConfirmRequest extends BaseRequest {

    /**
     * 危急值信息
     */
    @XmlElement(name = "LabWarnRecord")
    private LabWarnRecord labWarnRecord;
    /**
     * 闭环信息
     */
    @XmlElement(name = "ClpInfo")
    private ClpInfo clpInfo;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class LabWarnRecord {

        /**
         * 危急值报告编号
         */
        @XmlElement(name = "WarnId")
        private String warnId;
        /**
         * 危急值发布机构代码
         */
        @XmlElement(name = "ReportOrganization")
        @JsonProperty("visitOrganization")
        private String reportOrganization;
        /**
         * 危急值处理人类型
         */
        @XmlElement(name = "TreatorType")
        private String treatorType;
        /**
         * 处理时间
         */
        @XmlElement(name = "TreatDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date treatDateTime;
        /**
         * 处理人代码
         */
        @XmlElement(name = "Treator")
        @JsonProperty("treatorCode")
        private String treator;
        /**
         * 处理结果
         */
        @XmlElement(name = "TreatResult")
        private String treatResult;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class ClpInfo {

        /**
         * 业务ID
         */
        @XmlElement(name = "BusinessID")
        private String businessID;
        /**
         * 业务循环节点ID
         */
        @XmlElement(name = "BusinessCircleID")
        private String businessCircleID;
        /**
         * 多主键业务ID
         */
        @XmlElement(name = "BusinessCompsiteID")
        private String businessCompsiteID;
        /**
         * 流程编码
         */
        @XmlElement(name = "FlowCode")
        private String flowCode;
        /**
         * 流程名称
         */
        @XmlElement(name = "FlowName")
        private String flowName;
        /**
         * 操作类型编码
         */
        @XmlElement(name = "OperateTypeCode")
        private String operateTypeCode;
        /**
         * 操作类型名称
         */
        @XmlElement(name = "OperateTypeName")
        private String operateTypeName;
        /**
         * 操作员工号
         */
        @XmlElement(name = "OperatorCode")
        private String operatorCode;
        /**
         * 操作员姓名
         */
        @XmlElement(name = "OperatorName")
        private String operatorName;
        /**
         * 操作科室代码
         */
        @XmlElement(name = "OperateDeptCode")
        private String operateDeptCode;
        /**
         * 操作科室姓名
         */
        @XmlElement(name = "OperateDeptName")
        private String operateDeptName;
        /**
         * 操作日期时间
         */
        @XmlElement(name = "OperateDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date operateDateTime;
        /**
         * 分组id
         */
        @XmlElement(name = "GroupId")
        private String groupId;
        /**
         * 分组名称
         */
        @XmlElement(name = "GroupName")
        private String groupName;
        /**
         * 备注信息
         */
        @XmlElement(name = "OperateComments")
        private String operateComments;
    }

}
